package org.fms.web.service.impl;

import org.fms.web.mapper.UserMapper;
import org.fms.web.model.User;
import org.fms.web.service.LoginService;
import org.fms.web.service.vo.UserVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * PACKAGE     : org.fms.web.service.impl
 * CREATE DATE : 2018-03-03
 * AUTHOR      : xiaolu.fan
 * 文件描述     : 登录业务
 */
@Service
public class LoginServiceImpl implements LoginService {


    @Resource
    private UserMapper userMapper;

    @Override
    public UserVO getLoginUser(String username, String password) {
        User user = userMapper.getUserByName(username, password);
        UserVO userVO = new UserVO();
        BeanUtils.copyProperties(user, userVO);
        return userVO;
    }



}